<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>Layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="../../layuiAdmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="../../src/all.css" media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
  <style>
    .margin-top {
      margin-top: 20px;
    }

    .h1 {
      font-size: 20px;
      /* padding-left: 50px; */
    }

    .layui-form-label {
      white-space: nowrap;
    }

    .height {
      height: 20px;
    }

    .name {
      padding: 0 20px;
    }
  </style>
</head>


<body style="background-color: #fff;">

  <div class="layui-fluid">
    <div class="layui-card margin-top">
      <form action="" class="layui-form">
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">排查人</label>
            <div class="layui-input-inline">
              <select name="interest" lay-filter="aihao">
                <option value="">请选择</option>
                <option value="0">梅峰漳</option>
                <option value="1">梅峰漳</option>
                <option value="1">管理员</option>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">排查部门</label>
            <div class="layui-input-inline">
              <select name="mudoles" " lay-search="">
                <option value="">点击选择</option>
                <option value=" 1">五矿</option>
                <option value="1">二矿</option>
                <option value="1">三矿</option>
                <option value="1">一矿</option>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">排查地点</label>
            <div class="layui-input-inline">
              <select name="mudoles" " lay-search="">
                <option value="">直接选择或搜索选择</option>
                <option value=" 1">1304轨道顺槽</option>
                <option value="1">1304轨道顺槽</option>
                <option value="1">1304轨道顺槽</option>
                <option value="1">1304轨道顺槽</option>
              </select>
            </div>
          </div>
        </div>
      </form>
    </div>
    <table class="layui-hide" id="test" lay-filter="test"></table>
  </div>

  <script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container cl">
    <button class="layui-btn layui-btn-sm" lay-event='add'> <i class="layui-icon">&#xe608;</i>添加特殊隐患</button>
    <button class="layui-btn layui-btn-sm layui-btn-normal"  lay-event='get'> <i class="layui-icon">&#xe608;</i>提交（完成排查后点击）</button>
    <button class="layui-btn layui-btn-sm layui-btn-warm" lay-event='over'> <i class="layui-icon">&#xe608;</i>提交并直接下达（完成排查后点击）</button>
  </div>
</script>

  <script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-sm layui-btn-xs" lay-event="sel">排查</a>
  </script>
  <script type="text/html" id="add">
    <form
        id="dictDataEditForm"
        lay-filter="dictDataEditForm"
        class="layui-form model-form"
        style="padding-left: 10px;"
      >
        <input name="dictDataId" type="hidden" />
        <div class="layui-form-item">
          <label
            class="layui-form-label layui-form-required"
            style="padding-left: 0;width: 95px;"
            >字典项名称:</label
          >
          <div class="layui-input-block">
            <input
              name="dictDataName"
              placeholder="请输入字典项名称"
              class="layui-input"
              lay-verType="tips"
              lay-verify="required"
              required
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label
            class="layui-form-label layui-form-required"
            style="padding-left: 0;width: 95px;"
            >字典项代码:</label
          >
          <div class="layui-input-block">
            <input
              name="dictDataCode"
              placeholder="请输入字典键值"
              class="layui-input"
              lay-verType="tips"
              lay-verify="required"
              required
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label layui-form-required">排序号:</label>
          <div class="layui-input-block">
            <input
              name="sortNumber"
              placeholder="请输入排序号"
              class="layui-input"
              type="number"
              lay-verType="tips"
              lay-verify="required"
              required
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">备注:</label>
          <div class="layui-input-block">
            <textarea
              name="comments"
              placeholder="请输入备注"
              class="layui-textarea"
            ></textarea>
          </div>
        </div>
        <div class="layui-form-item text-right">
          <button class="layui-btn" lay-filter="dictDataEditSubmit" lay-submit>
            保存
          </button>
          <button
            class="layui-btn layui-btn-primary"
            type="button"
            ew-event="closeDialog"
          >
            取消
          </button>
        </div>
      </form>
  </script>

  <script src="../../layuiAdmin/layui/layui.all.js" charset="utf-8"></script>
  <!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->

  <script>
    layui.use(['form', 'layedit', 'laydate', 'table'], function () {
      var table = layui.table
        , form = layui.form
        , layer = layui.layer
        , layedit = layui.layedit
        , $ = layui.jquery
        , laydate = layui.laydate;
      //日期
      laydate.render({
        elem: '#date'
      });
      table.render({
        elem: '#test'
        , url: '/js/table.json'
        , toolbar: '#toolbarDemo' //开启头部工具栏，并为其绑定左侧模板
        , title: '用户数据表'
        , cols: [[
          { type: 'numbers', fixed: 'left' },
          { type: 'checkbox', fixed: 'left' }
          , { field: 'id', title: 'ID', fixed: 'left', unresize: true, sort: true, hide: true }
          , { field: 'unit', title: '排查项', fixed: 'left', unresize: true, sort: true }
          , { field: 'ys', title: '排查要素' }
          , { field: 'content', title: '隐患内容' }

        ]]
        , page: true
      });

      //头工具栏事件
      table.on('toolbar(test)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id);
        switch (obj.event) {
          case 'add':
            //新建
            layer.open({
              type: 1,
              zIndex: layer.zIndex, //重点1
              title: '新建排查表',
              shadeClose: true,
              // shade: true,
              maxmin: false, //开启最大化最小化按钮
              area: ['60%', '50%'],
              content: $('#add').html(),
              success: function (layero) {
                //layer.setTop(layero); //重点2
              },
              end: function () {
                window.location.reload();
              }

            });
            break;
          case 'get':
            layer.msg('已提交');
            break;
          case 'over':
            layer.msg('已下达');
            break;

        };
      });

      //监听行工具事件
      table.on('tool(test)', function (obj) {
        var data = obj.data;
        if (obj.event === 'sel') {
          //排查
          layer.open({
            type: 2,
            zIndex: layer.zIndex, //重点1
            title: '排查',
            shadeClose: true,
            // shade: true,
            maxmin: false, //开启最大化最小化按钮
            area: ['100%', '100%'],
            content: '/page/排查/排查.html',
            success: function (layero) {
              //layer.setTop(layero); //重点2
            },
            end: function () {
              // window.location.reload();
            }

          });
        }
      });
    });
  </script>

</body>

</html>